package com.li.decoratorpattern;

public class Test {
    public static void main(String[] args) {
        UserModel userModel=new UserModel(new UserAbstract() {
            @Override
            public String getName() {
                return "普通人";
            }

            @Override
            public double getIncome() {
                return 20;
            }
        });
        System.out.println(userModel.getName()+"-收入:"+userModel.getIncome());
        WorkUser workUser=new WorkUser(userModel);
        System.out.println(workUser.getName()+"-收入:"+workUser.getIncome());
        BossUser bossUser=new BossUser(workUser);
        System.out.println(bossUser.getName()+"-收入:"+bossUser.getIncome());
    }
}
